{block name="main"}
<!--搜索结果-->
<div class="search-results w1200 clearfix" style="padding-top: 10px;">
    <!--左侧搜索结果-->
    <div class="results-rblock">
        <div class="second-filter clearfix">
            <div class="filterSort fl">
                <a href="{:__URL('ADDONS_SHOP_MAIN','addons=shopGoodList&shop_id='.$shop_id.$condition_url)}" class="nofollow{if condition="$order_type  eq ''"} active {/if}">综合</a>
                {volist name="screen_list_two" id="vo" key="k" }
                     {if condition="$order_type eq $vo.order_type"}
                            {if condition="$sort eq 'desc'"}
                                    <a href="{:__URL('ADDONS_SHOP_MAIN','addons=shopGoodList&'.$condition_url.'&shop_id='.$shop_id.'&order_type='.$vo['order_type'].'&sort=asc')}" class="nofollow active"> {$vo.order_name}
                                    <i class="icon-dowm"></i></a>
                            {else /}
                                    <a href="{:__URL('ADDONS_SHOP_MAIN','addons=shopGoodList&'.$condition_url.'&shop_id='.$shop_id.'&order_type='.$vo['order_type'].'&sort=desc')}" class="nofollow active"> {$vo.order_name}
                                    <i class="icon-dowm"></i></a>
                            {/if}
                    {else /}
                            <a href="{:__URL('ADDONS_SHOP_MAIN','addons=shopGoodList&'.$condition_url.'&shop_id='.$shop_id.'&order_type='.$vo['order_type'].'&sort=desc')}" class="nofollow"> {$vo.order_name} <i class="icon-dowm"></i> </a>
                    {/if}
                {/volist}
            </div>
            <input type="hidden" id="hidden_category_id" value="{$category_id}"/>
            <input type="hidden" id="hidden_brand_id" value="{$brand_id}"/>
            <input type="hidden" id="hidden_brand_name" value="{$brand_name}"/>
            <input type="hidden" id="hidden_min_price" value="{$min_price}"/>
            <input type="hidden" id="hidden_max_price" value="{$max_price}"/>
            <input type="hidden" id="hidden_url_parameter" value="{$url_parameter}"/>
            <div class="second-box fr clearfix">
                {if condition="$max_price==''&& $category_count>0 "}
                <div class="price-section-box fl">
                    <div class="price-input fl">
                        <div class="fl">
                            <input type="number" name="price_min" id="min_price" class="input-l" value="{$min_price}">
                        </div>
                        <em class="fl">-</em>
                        <div class="fl">
                            <input type="number" name="price_max" id="max_price" class="input-r" value="{$max_price}">
                        </div>
                    </div>
                    <div class="price-sure fl">
                        <a class="sure" id="search_sure" href="javascript:void(0);">确定</a>

                    </div>
                </div>
                {/if}
                <div class="little-page fr">
                    {if condition="$page>1"}
                    <a href="{:__URL('SHOP_MAIN/'.$path_info,'page='.($page-1).$query_string)}"><i class="icon-dir-left2"></i></a>
                    {else/}
                    <a href="javascript:void(0);"><i class="icon-dir-left2"></i></a>
                    {/if}
                    <span>{$page}/{$page_count}</span>
                    {if condition="$page neq $page_count"}
                    <a href="{:__URL('SHOP_MAIN/'.$path_info,'page='.($page+1).$query_string)}"><i class="icon-dir-right3"></i></a>
                    {else /}
                    <a href="javascript:void(0);"><i class="icon-dir-right3"></i></a>
                    {/if}
                </div>
                <div class="showStyle fr">
                    <ul class="showStyle-ul">
                        <li data-type="grid" class="active"><a href="javascript:;" class="links"><i class="icon-screen"></i></a></li>
                        <li data-type="list"><a href="javascript:;" class="links"><i class="icon-stretch"></i></a></li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="filter-row">
            {if condition = "$is_shipping_fee eq 1"}
            <a href="{:__URL('ADDONS_SHOP_MAIN','addons=shopGoodList&shop_id='.$shop_id.'&order_type='.$order_type.'&sort='.$sort)}" class="filter-tag"><i class="icon-stretch"></i>包邮</a>
            {else/}
            <a href="{:__URL('ADDONS_SHOP_MAIN','addons=shopGoodList&shop_id='.$shop_id.'&order_type='.$order_type.'&sort='.$sort.'&is_shipping_fee=1')}" class="filter-tag "><i class="icon-stretch"></i>包邮</a>
            {/if}
            {if condition = "$is_stock eq 1"}
            <a href="{:__URL('ADDONS_SHOP_MAIN','addons=shopGoodList&shop_id='.$shop_id.'&order_type='.$order_type.'&sort='.$sort)}" class="filter-tag"><i class="icon-stretch"></i>仅显示有货</a>
            {else/}
            <a href="{:__URL('ADDONS_SHOP_MAIN','addons=shopGoodList&shop_id='.$shop_id.'&order_type='.$order_type.'&sort='.$sort.'&is_stock=1')}" class="filter-tag "><i class="icon-stretch"></i>仅显示有货</a>
            {/if}
        </div>
        <div class="filter-results" style="display: block">
            <ul class="clearfix wrap-ul">
                {volist name="good_list" id="goods" key="k"}
                <li>
                    <div class="wrap-box">
                        <div class="wrap-img pr">
                            <a href="{:__URL('SHOP_MAIN/goods/goodsinfo','goodsid='.$goods['goods_id'])}" class="wrap-img-a" target="_blank" title="{$goods.goods_name}">
                                <img src="{:__IMG($goods['pic_cover_mid'])}" alt="">
                            </a>
                            <div class="wrap-img-tips">
                                <a href="javascript:void(0);" class="add-cart" data-id="{$goods['goods_id']}" data-name="{$goods['goods_name']}" data-pic="{$goods['pic_id']}" data-max_buy="{if condition='$goods.max_buy==0' }{$goods.stock}{else/}{$goods.max_buy}{/if}" data-state="{$goods['state']}">加入购物车</a>
                                <a href="javascript:void(0);" class="collect-goods  J-collect-{$k}" data-key="{$k}" data-id="{$goods['goods_id']}" data-collect="{$goods.is_favorite}">{if condition="$goods.is_favorite>0"}已收藏{else}收藏商品{/if}</a>
                            </div>
                        </div>
                        <div class="wrap-info">
                            <div class="wrap-title"><a class="pName" href="{:__URL('SHOP_MAIN/goods/goodsinfo','goodsid='.$goods['goods_id'])}" target="_blank" title="{$goods.goods_name}">{$goods.goods_name}</a></div>

                            <div class="wrap-sell clearfix">
                                <div class="fl red">￥{$goods.price}</div>
                                <div class="fr">销量：{$goods.sales}</div>
                            </div>
                        </div>
                    </div>
                    {foreach name="goods['sku_list']" item="pro_skus" key="k"}
                    <input type="hidden" name="goods_sku{$goods.goods_id}" value="{$pro_skus.attr_value_items};" stock="{$pro_skus.stock}"  price="{$pro_skus.price}" skuid="{$pro_skus.sku_id}" skuname="{$pro_skus.sku_name}">
                           {/foreach}
                </li>
                {/volist}
            </ul>
        </div>
        <div class="filter-results2" style="display: none">
            <div class="list-box">
                {volist name="good_list" id="goods"  key="k"}
                <div class="list-box-item clearfix">
                    <div class="fl col1">
                        <div class="pic-box-inner">
                            <a href="{:__URL('SHOP_MAIN/goods/goodsinfo','goodsid='.$goods['goods_id'])}" class="pic-link" target="_blank" title="{$goods.goods_name}">
                                <img src="{:__IMG($goods['pic_cover_mid'])}" alt="">
                            </a>
                        </div>
                    </div>
                    <div class="fl col2">
                        <p class="list-box-item-name">
                            <a href="{:__URL('SHOP_MAIN/goods/goodsinfo','goodsid='.$goods['goods_id'])}" class="J_ClickStat" target="_blank" title="{$goods.goods_name}">{$goods.goods_name}</a>
                        </p>
                    </div>
                    <div class="fl col3 red">￥{$goods.price}</div>
                    <div class="fl col4">销量：{$goods.sales}</div>
                    <div class="fl col5">
                        <a href="javascript:void(0);" class="add-cart" data-id="{$goods['goods_id']}" data-name="{$goods['goods_name']}" data-pic="{$goods['pic_id']}" data-max_buy="{if condition='$goods.max_buy==0' }{$goods.stock}{else/}{$goods.max_buy}{/if}" data-state="{$goods['state']}">加入购物车</a>
                        <a href="javascript:void(0);" class="collect-goods J-collect-{$k}"  data-key="{$k}" data-id="{$goods['goods_id']}" data-collect="{$goods.is_favorite}">{if condition="$goods.is_favorite>0"}已收藏{else}收藏商品{/if}</a>
                    </div>
                </div>
                {/volist}
            </div>
        </div>
        <div class="js-show-page">
            {include file='template/shop/controlCommonPage'/}
        </div>
    </div>
    <!--右侧推荐-->
    <div class="results-lblock">
        {if condition="[is_new_recommend] neq '0'"}
        <div class="trade-item-title"><span class="text">新品推荐</span></div>
        <ul class="lblock-ul">
            {foreach name="goods_new_list" item="goodsinfo" key="k"}
            <li>
                <div class="lblock-ul-box">
                    <div class="lblock-img pr">
                        <a target="_blank" title="{$goodsinfo.goods_name}" href="{:__URL('SHOP_MAIN/goods/goodsinfo','goodsid='.$goodsinfo['goods_id'])}">
                            <img src="{:__IMG($goodsinfo['picture_info']['pic_cover'])}" alt="">
                        </a>
                        <div class="lblock-img-tips">
                            {$goodsinfo.goods_name}
                        </div>
                    </div>
                    <div class="clearfix lblock-sells">
                        <div class="fl red">￥{$goodsinfo.price}</div>
                        <div class="fr">销量：{$goodsinfo.sales}</div>
                    </div>
                </div>
            </li>
            {/foreach}
        </ul>
    </div>
    {/if}
</div>
<!--猜你喜欢部分-->
<div class="guessBuy w1200">
    <ul class="clearfix guessBuy-ul">
        <li class="active" data-type='guess'>猜你喜欢</li>
        <li data-type='history'>浏览历史</li>
        <div class="fr J-changeLike">
            <a href="javascript:void(0);">换一批</a>
        </div>
        <div class="fr J-del" style='display:none;'>
            <a href="javascript:void(0);">清空</a>
        </div>
    </ul>
    <div class="browse-history-con">
        <div class="browse-history-inner">
            <ul id="user_like" class="recommend-panel">
            </ul>
        </div>
    </div>
</div>
<!--加入购物车弹窗-->
<div id="speDiv" style="display: none;">
    <div class="pop-header">
        <span>{:lang('goods_select_commodity_attribute')}</span> <a href="javascript:void(0)" title="{:lang('goods_add_cart')}" class="spe-close J-closespe"></a>
    </div>
    <div class="attr-list js-sku-list" style="margin: 0;"><!-- ajax 加载sku属性--></div>
    <div class="spe-btn">
        <a href="javascript:void(0)" class="sure-btn J-addfromlist">加入购物车</a>
        <a href="javascript:void(0)" class="cancel-btn J-closespe">取消</a>
    </div>
    <input type="hidden" id="hidden_goodsid" />
    <input type="hidden" id="hidden_goods_name" />
    <input type="hidden" id="hidden_skuid" />
    <input type="hidden" id="hidden_skuname" />
    <input type="hidden" id="hidden_sku_price" />
    <input type="hidden" id="hidden_default_img_id" />
    <input type="hidden" id="hidden_max_buy" />
    <input type="hidden" id="hidden_attr_item" value="{$attr_str}"/>
    <input type="hidden" id="hidden_spec_item" value="{$spec_str}"/>
</div>
<div id="mask"></div>
    <!-- page end -->
{/block}
{block name="javascript"}
<script>
    require(['dialog', 'goodslist'], function (Dialog, GoodsList) {
        Dialog.withAccount(".search-tabs", "li", "active");
        Dialog.withAccount(".sortSearch-tab", "li", "active");
        Dialog.withAccount(".sort-tab", "li", "active");
        GoodsList.operation();
        $(".j_More").on("click", function () {
            $(this).parent().siblings("ul").toggleClass("av-expand");
            $(this).parent().siblings("ul").toggleClass("av-collapse");
        });

        // 点击选中框
        $(".av-state").on("click", "li", function () {
            if ($(this).parents(".j_Cate").hasClass("multiple")) {
                $(this).children("a").children("i").toggleClass("icon-selected").toggleClass("iBorders");
            }

        });
        // 点击多选确定
        $(".J_btnsConfirm").on("click", function () {
            var isSelected = $(this).parent(".sl-btns").siblings("ul").find("i").hasClass("icon-selected");
            if (!isSelected) {
                layer.msg("请选择", {
                    icon: 2,
                    time: 1000
                });
            } else {
                $(this).parents(".sl-btns").siblings(".av-options").show();
                $(this).parents(".sl-btns").siblings(".av-state").toggleClass("av-expand av-collapse");
                $(this).parents(".sl-btns").toggleClass("hovers");
                $(this).parents(".j_Cate").toggleClass("multiple");
                $(this).parents(".sl-btns").siblings(".av-state").find("i").removeClass("icon-selected");
            }
        });
    })
</script>
{/block}